<div class="report-FILEInfo" ng-if="success">
    <style>
        .report-FILEInfo dl {
            margin-bottom: 2px;
        }

    </style>

    <!--  File Indenfication -->
    <div class="panel panel-info">
        <div class="panel-heading">
            <strong>File Identification</strong>
        </div>
        <div class="panel-body">
            <dl class="dl-horizontal">
                <dt>MD5</dt>
                <dd class="wrap">{{content.Identification['MD5']}}</dd>
            </dl>
            <dl class="dl-horizontal">
                <dt>SHA1</dt>
                <dd class="wrap">{{content.Identification['SHA1']}}</dd>
            </dl>
            <dl class="dl-horizontal">
                <dt>SHA256</dt>
                <dd class="wrap">{{content.Identification['SHA256']}}</dd>
            </dl>
            <dl class="dl-horizontal" ng-if="content.Identification['impash']">
                <dt>impash</dt>
                <dd class="wrap">{{content.Identification['impash']|| "-"}}
                </dd>
            </dl>
            <dl class="dl-horizontal" ng-if="content.Identification['ssdeep']">
                <dt>ssdeep</dt>
                <dd class="wrap">{{content.Identification['ssdeep']|| "-"}}
                </dd>
            </dl>
            <dl class="dl-horizontal" ng-if="content.Identification['pehash']">
                <dt>pehash</dt>
                <dd class="wrap">{{content.Identification['pehash']|| "-"}}
                </dd>
            </dl>
            <dl class="dl-horizontal" ng-if="content.Identification['OperatingSystem']">
                <dt>Operating System</dt>
                <dd class="wrap">{{content.Identification['OperatingSystem']}}
                </dd>
            </dl>
            <dl class="dl-horizontal" ng-if="content.Identification['PEType']">
                <dt>PE Type</dt>
                <dd class="wrap">{{content.Identification['PEType']}}</dd>
            </dl>
            <dl class="dl-horizontal">
                <dt>Magic literal</dt>
                <dd class="wrap">{{content.Magic}}</dd>
            </dl>
            <dl class="dl-horizontal">
                <dt>MimeType</dt>
                <dd class="wrap">{{content.Mimetype}}</dd>
            </dl>
        </div>
    </div>

    <!-- File Metadata -->
    <div class="panel panel-info">
        <div class="panel-heading">
            <strong>File Metadata (Exiftool)</strong>
        </div>
        <div class="panel-body">
            <dl class="dl-horizontal" ng-repeat="(k,v) in content.Exif">
                <dt>{{k}}</dt>
                <dd class="wrap">{{v}}</dd>
            </dl>
            <!-- <div ui-codemirror="{
            lineNumbers: true,
                  theme:'twilight',
                  readOnly: 'nocursor',
                  lineWrapping : true
          }" ng-model="content['Exif']">
        </div> -->
        </div>
    </div>

    <!-- PE Basic Information -->
    <div class="panel panel-info" ng-if="content.PE.BasicInformation">
        <div class="panel-heading">
            <strong>PE Basic Information</strong>
        </div>
        <div class="panel-body">
            <dl class="dl-horizontal" ng-repeat="I in content.PE.BasicInformation.FileInfo">
                <dt>{{I.Info}}</dt>
                <dd class="wrap">{{I.Value}}</dd>
            </dl>
            <dl class="dl-horizontal">
                <dt>Compilation Timestamp</dt>
                <dd class="wrap">{{content.PE.BasicInformation.CompilationTimestamp}}</dd>
            </dl>
            <dl class="dl-horizontal">
                <dt>File Size</dt>
                <dd class="wrap">{{content.PE.BasicInformation.FileSize}}</dd>
            </dl>
            <dl class="dl-horizontal">
                <dt>Entry Point (EP)</dt>
                <dd class="wrap">{{content.PE.BasicInformation.EntryPoint}}</dd>
            </dl>
            <dl class="dl-horizontal">
                <dt>Target Machine</dt>
                <dd class="wrap">{{content.PE.BasicInformation.TargetMachine}}</dd>
            </dl>
        </div>
    </div>

    <!-- PE Sections -->
    <div class="panel panel-info" ng-if="content.PE.Sections">
        <div class="panel-heading">
            <strong>PE Sections</strong>
        </div>
        <div class="panel-body">
            <table class="table">
                <thead>
                    <th>Section</th>
                    <th>SizeOfRawData</th>
                    <th>Entroy</th>
                </thead>
                <tbody ng-repeat="section in content.PE.Sections">
                    <tr>
                        <td>
                            <b>{{section.entryname}}</b>
                        </td>
                        <td>{{section.SizeOfRawData}}</td>
                        <td>{{section.Entropy}}</td>
                    </tr>
                    <tr>
                        <td colspan=3>
                            <dl class="dl-horizontal">
                                <dt>
                                    <small>MD5</small>
                                </dt>
                                <dd>
                                    <small>{{section.MD5}}</small>
                                </dd>
                            </dl>
                            <dl class="dl-horizontal">
                                <dt>
                                    <small>SHA1</small>
                                </dt>
                                <dd>
                                    <small>{{section.SHA1}}</small>
                                </dd>
                            </dl>
                            <dl class="dl-horizontal">
                                <dt>
                                    <small>SHA256</small>
                                </dt>
                                <dd>
                                    <small>{{section.SHA256}}</small>
                                </dd>
                            </dl>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <!-- PE Import Address Table -->

    <div class="panel panel-info" ng-if="content.PE.ImportAdressTable">
        <div class="panel-heading">
            <strong>PE Import Address Table</strong>
        </div>
        <div class="panel-body">
            <dl class="dl-horizontal" ng-repeat="entry in content.PE.ImportAdressTable" ng-init="entry.showRows=false;">
                <dt>
                    <a href="" ng-click="entry.showRows = !entry.showRows">
                        <i class="fa" ng-class="{ true:'fa-minus-square-o', false:'fa-plus-square-o' }[entry.showRows]"></i>
                    </a>
                    {{entry.entryname}}
                </dt>
                <!-- <div>
                <span class="label label-info" ng-if="entry.showRows" ng-repeat="sym in entry.symbols">{{sym}}
                </span>
              </div> -->
                <dd>
                    <div ng-if="!entry.showRows">
                        {{entry.symbols.length}}
                        items
                    </div>
                    <div ng-if="entry.showRows">
                        <div ng-repeat="sym in entry.symbols">
                            <small>{{sym}}</small>
                        </div>
                    </div>
                </dd>
            </dl>
        </div>
    </div>

    <!-- MSOffice OLEVBA Report -->
    <div class="panel panel-info" ng-if="content.MSOffice.olevba.Version">
        <div class="panel-heading">
            <strong>Olevba Report</strong>
        </div>
        <div class="panel-body">
            <p class="lead">Summary</p>
            <dl class="dl-horizontal">
                <dt>Olevba version:</dt>
                <dd>v{{content.MSOffice.olevba.Version}}</dd>
            </dl>

            <dl class="dl-horizontal">
                <dt>Olevba detection :</dt>
                <dd>{{content.MSOffice.olevba.vba}}</dd>
            </dl>

            <dl class="dl-horizontal">
                <dt>Olevba scanner :</dt>
                <dd>
                    <span ng-switch="content.MSOffice.olevba['vba']">
                        <span ng-switch-when="VBA Macros found">
                            <span class="label" ng-class="{true:'label-danger', false:'label-warning'}[content.MSOffice.olevba['Suspicious']]">
                                <span ng-if="content.MSOffice.olevba['Suspicious'] === false">Not suspicious</span>
                                <span ng-if="content.MSOffice.olevba['Suspicious'] === true">Suspicious VBA</span>
                            </span>&nbsp;
                            <span class="label" ng-class="{true:'label-danger'}[content.MSOffice.olevba['Base64 Strings']]">
                                <span ng-if="content.MSOffice.olevba['Base64 Strings'] === true">Base64 strings</span>
                            </span>&nbsp;
                            <span class="label" ng-class="{true:'label-danger'}[content.MSOffice.olevba['Hex Strings']]">
                                <span ng-if="content.MSOffice.olevba['Hex Strings'] === true">Hex strings</span>
                            </span>
                        </span>
                        <span ng-switch-default>
                            <span class="label label-success">
                                Not suspicious
                            </span>
                        </span>
                    </span>
                </dd>
            </dl>

            <div ng-if="content.MSOffice.olevba.streams">
                  <p class="lead">Detailed Information</p>

                  <div ng-repeat="stream in content.MSOffice.olevba.streams">
                      <div class="panel panel-default">
                          <div class="panel-heading">
                              <h3 class="panel-title">OLE stream:
                                  {{stream['OLE stream']}}</h3>
                          </div>
                          <div class="panel-body">
                              <h5>Information</h5>
                              <dl class="dl-horizontal">
                                  <dt>VBA filename:</dt>
                                  <dd>{{stream['VBA filename']}}</dd>
                              </dl>
                              <dl class="dl-horizontal">
                                  <dt>Filename:</dt>
                                  <dd>{{stream['Filename']}}</dd>
                              </dl>

                              <div ng-if="stream.scan_result[0]">
                                  <h5>Olevba analysis</h5>
                                  <div class="table-responsive">
                                      <table class="table">
                                          <thead>
                                              <tr>
                                                  <th >Type</th>
                                                  <th >Keyword</th>
                                                  <th >Description</th>
                                              </tr>
                                          </thead>
                                          <tbody ng-repeat="result in stream.scan_result">
                                              <tr>
                                                  <td>{{result.type}}</td>
                                                  <td>{{result.keyword}}</td>
                                                  <td>{{result.description}}</td>
                                              </tr>
                                          </tbody>
                                      </table>

                                  </div>
                              </div>

                              <div ng-if="stream['VBA code'] && stream['VBA code'] != '' ">
                                  <a href ng-init="isCollapsed = true" ng-click="isCollapsed = !isCollapsed">
                                      <span ng-if="isCollapsed">Show code</span>
                                      <span ng-if="!isCollapsed">Hide code</span>
                                  </a>
                                  <br>
                                  <div collapse="isCollapsed">
                                    <!--   <div
                                          ui-codemirror="{
                                      lineNumbers: true,
                                      theme:'twilight',
                                      readOnly: 'nocursor',
                                      lineWrapping : true,
                                      mode: 'vb'
                                      }"
                                          ng-model="stream['VBA code']"></div> -->
                                    <pre >
                                      {{stream['VBA code']}}
                                    </pre>
                                      <!-- <span style="white-space: pre-wrap"> -->
                                      <!-- {{stream['VBA code']}} -->
                                      <!-- </span> -->
                                  </div>
                              </div>

                          </div>
                      </div>
                  </div>
              </div>

            <div ng-if="content.MSOffice.olevba.Error">
                  <div class="panel panel-danger">
                      <div class="panel-heading">
                          <strong>Analysis failure</strong>
                      </div>
                      <div class="panel-body">
                          {{content.MSOffice.olevba.Error}}
                      </div>
                  </div>
              </div>
        </div>

      </div>



    <!-- PDF PDFiD Report -->
    <div class="panel panel-info" ng-if="content.PDF.pdfid[0].pdfid.version">
        <div class="panel-heading">
            <strong>PDFiD Report</strong>
        </div>
        <div class="panel-body">
          <p class="lead">Summary</p>
          <dl class="dl-horizontal">
              <dt>PDFiD version:</dt>
              <dd>v{{content.PDF.pdfid[0].pdfid.version}}</dd>
          </dl>

          <dl class="dl-horizontal">
              <dt>Suspicious: </dt>
              <dd>{{content.PDF.pdfid[0].suspicious}}</dd>
          </dl>

          <dl class="dl-horizontal">
              <dt>PDFiD detection :</dt>
              <dd>
                <span ng-if="content.PDF.pdfid[0].suspicious === true">
                  <span ng-if="content.PDF.pdfid[0].detections['/RichMedia'] !== 0">
                    <span class="label label-warning">
                      /RichMedia
                    </span>&nbsp;
                  </span>
                  <span ng-if="content.PDF.pdfid[0].detections['/OpenAction'] !== 0">
                    <span class="label label-warning">
                      /OpenAction
                    </span>&nbsp;
                  </span>
                  <span ng-if="content.PDF.pdfid[0].detections['/JavaScript'] !== 0">
                    <span class="label label-warning">
                      /JavaScript
                    </span>&nbsp;
                  </span>
                  <span ng-if="content.PDF.pdfid[0].detections['/Launch'] !== 0">
                    <span class="label label-warning">
                      /Launch
                    </span>&nbsp;
                  </span>
                  <span ng-if="content.PDF.pdfid[0].detections['/ObjStm'] !== 0">
                    <span class="label label-warning">
                      /ObjStm
                    </span>&nbsp;
                  </span>
                </span>
              </dd>
          </dl>
        </div>

    </div>
</div>


<!-- General error  -->
<div class="panel panel-danger" ng-if="!success">
    <div class="panel-heading">
        <strong>{{(artifact.data || artifact.attachment.name) | fang}}</strong>
    </div>
    <div class="panel-body">
        {{content.errorMessage}}
    </div>
</div>
